<?php


class Kategorie_Controller extends Controller
{
	/*public function dostawcy($param1 = null, $param2 = null)
	{
		parent::dostawcy($param1, $param2);
	}*/
        public function __construct()
	{
		parent::__construct();
                $this->session=new Session();
	}
        public function index()
        {
            $this['menu']='a';
            $kat=new Kategoria_Model();
            $kategorie=$kat->pobierz_kategorie_wawa();
            $this['kategorie']=$kategorie;
            echo $this->render('panel_admina/panel_admina.html');
        }
        public function dodaj()
        {
            if($this->input->post('kategoria'))
            {
                $kategoria=new Kategoria_Model();
                $kategoria->dodaj_kategorie($this->input->post('kategoria'));
            }
            $this['menu']='a';
            $kat=new Kategoria_Model();
            $kategorie=$kat->pobierz_kategorie_wawa();
            $this['kategorie']=$kategorie;
            echo $this->render('panel_admina/panel_admina.html');
        }
        public function panel_admina()
        {
            $kat=new Kategoria_Model();
            $kategorie=$kat->pobierz_kategorie_wawa();
            $this['kategorie']=$kategorie;
            echo $this->render('panel_admina/panel_admina.html');
        }
        public function dodaj_kategorie()
        {
            $kategoria=new Kategoria_Model();
            $kategoria->dodaj_kategorie($this->input->post('kategoria'));
            $this->panel_admina();
        }
}